﻿/* @(#)/C:\\APEP3\\JavaSourceOutput\UploadFilesBase.java    V1.0
 *
 * Project: APEP 
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *   wangp    {CREATE_TIME} First release
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2007 Auto-Parts E-Procurement Co., Ltd. 
 *        No.251-1 Wuning Road, Shanghai, 200063, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Auto-Parts E-Procurement Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with APEP.
 *
 * Warning:
 * =============================================================================
 *   
 * 
 */

package com.apep.gw.data;

import java.util.*;

import framework.core.*;
/*
	Author    :wangp
	CreateTime:{CREATE_TIME}
*/
public class UploadFilesBase extends Table 
{
public static final String TABLE_NAME = "T_UPLOAD_FILES";

private static final String BACKUP_TABLE_NAME = "T_UPLOAD_FILES_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_UPLOAD_FILES_BACKUP";


public static final String ID = "ID";

public static final String WAREHOUSE_ID = "WAREHOUSE_ID";

public static final String FILE_NAME = "FILE_NAME";

public static final String FILE_PATH = "FILE_PATH";

public static final String FILE_TYPE = "FILE_TYPE";

public static final String FILE_LENGTH = "FILE_LENGTH";

public static final String IS_EXCUTE = "IS_EXCUTE";

public static final String CREATE_TIME = "CREATE_TIME";

public static final String EXCUTE_TIME = "EXCUTE_TIME";


public static Vector m_fields = null;


private int m_ID = Value.NULL_INT;  //序号

private String m_WAREHOUSE_ID = ""; //仓库ID

private String m_FILE_NAME = ""; //文件名

private String m_FILE_PATH = ""; //文件路径

private String m_FILE_TYPE = ""; //文件类型

private int m_FILE_LENGTH = Value.NULL_INT;  //文件大小

private int m_IS_EXCUTE = Value.NULL_INT;  //是否执行

private String m_CREATE_TIME = ""; //创建时间

private String m_EXCUTE_TIME = ""; //执行时间



	public int getId()
	{
	    return m_ID;
	}
	public void  setId(int v)
	{
		if(getId()==v) return ;
		m_ID = v ;
		markDirty(ID);
	}

	public String getWarehouseId()
	{
	    return m_WAREHOUSE_ID;
	}
	public void  setWarehouseId(String v)
	{
		if(getWarehouseId().equals(v)) return ;
		m_WAREHOUSE_ID = v ;
		markDirty(WAREHOUSE_ID);
	}

	public String getFileName()
	{
	    return m_FILE_NAME;
	}
	public void  setFileName(String v)
	{
		if(getFileName().equals(v)) return ;
		m_FILE_NAME = v ;
		markDirty(FILE_NAME);
	}

	public String getFilePath()
	{
	    return m_FILE_PATH;
	}
	public void  setFilePath(String v)
	{
		if(getFilePath().equals(v)) return ;
		m_FILE_PATH = v ;
		markDirty(FILE_PATH);
	}

	public String getFileType()
	{
	    return m_FILE_TYPE;
	}
	public void  setFileType(String v)
	{
		if(getFileType().equals(v)) return ;
		m_FILE_TYPE = v ;
		markDirty(FILE_TYPE);
	}

	public int getFileLength()
	{
	    return m_FILE_LENGTH;
	}
	public void  setFileLength(int v)
	{
		if(getFileLength()==v) return ;
		m_FILE_LENGTH = v ;
		markDirty(FILE_LENGTH);
	}

	public int getIsExcute()
	{
	    return m_IS_EXCUTE;
	}
	public void  setIsExcute(int v)
	{
		if(getIsExcute()==v) return ;
		m_IS_EXCUTE = v ;
		markDirty(IS_EXCUTE);
	}

	public String getCreateTime()
	{
	    return m_CREATE_TIME;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_CREATE_TIME = v ;
		markDirty(CREATE_TIME);
	}

	public String getExcuteTime()
	{
	    return m_EXCUTE_TIME;
	}
	public void  setExcuteTime(String v)
	{
		if(getExcuteTime().equals(v)) return ;
		m_EXCUTE_TIME = v ;
		markDirty(EXCUTE_TIME);
	}



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewWarehouseId(DBConnection con) throws Exception
	{
		return Value.view(getWarehouseId());
	}

	public String viewFileName(DBConnection con) throws Exception
	{
		return Value.view(getFileName());
	}

	public String viewFilePath(DBConnection con) throws Exception
	{
		return Value.view(getFilePath());
	}

	public String viewFileType(DBConnection con) throws Exception
	{
		return Value.view(getFileType());
	}

	public String viewFileLength(DBConnection con) throws Exception
	{
		return Value.view(getFileLength());
	}

	public String viewIsExcute(DBConnection con) throws Exception
	{
		return Value.view(getIsExcute());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewExcuteTime(DBConnection con) throws Exception
	{
		return Value.view(getExcuteTime());
	}



protected UploadFilesBase()
{
}

public void fill(UploadFilesPageData pageData) throws Exception
{

	if( pageData.getId()!=null && 
	   !pageData.getId().equals(""))
	{	
		setId(Integer.parseInt(pageData.getId()));
	}

	if(pageData.getWarehouseId()!=null)
	{	
		setWarehouseId(pageData.getWarehouseId());
	}

	if(pageData.getFileName()!=null)
	{	
		setFileName(pageData.getFileName());
	}

	if(pageData.getFilePath()!=null)
	{	
		setFilePath(pageData.getFilePath());
	}

	if(pageData.getFileType()!=null)
	{	
		setFileType(pageData.getFileType());
	}

	if( pageData.getFileLength()!=null && 
	   !pageData.getFileLength().equals(""))
	{	
		setFileLength(Integer.parseInt(pageData.getFileLength()));
	}

	if( pageData.getIsExcute()!=null && 
	   !pageData.getIsExcute().equals(""))
	{	
		setIsExcute(Integer.parseInt(pageData.getIsExcute()));
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

	if(pageData.getExcuteTime()!=null)
	{	
		setExcuteTime(pageData.getExcuteTime());
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_INT,true,true,0,"序号"));

		m_fields.add(new Field(WAREHOUSE_ID,Value.TYPE_STRING,false,true,32,"仓库ID"));

		m_fields.add(new Field(FILE_NAME,Value.TYPE_STRING,false,true,200,"文件名"));

		m_fields.add(new Field(FILE_PATH,Value.TYPE_STRING,false,true,200,"文件路径"));

		m_fields.add(new Field(FILE_TYPE,Value.TYPE_STRING,false,true,200,"文件类型"));

		m_fields.add(new Field(FILE_LENGTH,Value.TYPE_INT,false,true,0,"文件大小"));

		m_fields.add(new Field(IS_EXCUTE,Value.TYPE_INT,false,true,0,"是否执行"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,true,20,"创建时间"));

		m_fields.add(new Field(EXCUTE_TIME,Value.TYPE_STRING,false,true,20,"执行时间"));
	

	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_ID = getInt(rs,ID);

	m_WAREHOUSE_ID = getString(rs,WAREHOUSE_ID);

	m_FILE_NAME = getString(rs,FILE_NAME);

	m_FILE_PATH = getString(rs,FILE_PATH);

	m_FILE_TYPE = getString(rs,FILE_TYPE);

	m_FILE_LENGTH = getInt(rs,FILE_LENGTH);

	m_IS_EXCUTE = getInt(rs,IS_EXCUTE);

	m_CREATE_TIME = getString(rs,CREATE_TIME);

	m_EXCUTE_TIME = getString(rs,EXCUTE_TIME);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_ID))
	{
		return new Value(getWarehouseId());
	}

	if(f.equalsIgnoreCase(FILE_NAME))
	{
		return new Value(getFileName());
	}

	if(f.equalsIgnoreCase(FILE_PATH))
	{
		return new Value(getFilePath());
	}

	if(f.equalsIgnoreCase(FILE_TYPE))
	{
		return new Value(getFileType());
	}

	if(f.equalsIgnoreCase(FILE_LENGTH))
	{
		return new Value(getFileLength());
	}

	if(f.equalsIgnoreCase(IS_EXCUTE))
	{
		return new Value(getIsExcute());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}

	if(f.equalsIgnoreCase(EXCUTE_TIME))
	{
		return new Value(getExcuteTime());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getInt());
	}

	if(f.equalsIgnoreCase(WAREHOUSE_ID))
	{
		setWarehouseId(v.getString());
	}

	if(f.equalsIgnoreCase(FILE_NAME))
	{
		setFileName(v.getString());
	}

	if(f.equalsIgnoreCase(FILE_PATH))
	{
		setFilePath(v.getString());
	}

	if(f.equalsIgnoreCase(FILE_TYPE))
	{
		setFileType(v.getString());
	}

	if(f.equalsIgnoreCase(FILE_LENGTH))
	{
		setFileLength(v.getInt());
	}

	if(f.equalsIgnoreCase(IS_EXCUTE))
	{
		setIsExcute(v.getInt());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}

	if(f.equalsIgnoreCase(EXCUTE_TIME))
	{
		setExcuteTime(v.getString());
	}
	
}
public String toString()
{
	String msg = "UploadFiles=\n";
	msg += "(\r\n";

	msg += "    序号(ID)="+get("ID")+"\r\n";

	msg += "    仓库ID(WAREHOUSE_ID)="+get("WAREHOUSE_ID")+"\r\n";

	msg += "    文件名(FILE_NAME)="+get("FILE_NAME")+"\r\n";

	msg += "    文件路径(FILE_PATH)="+get("FILE_PATH")+"\r\n";

	msg += "    文件类型(FILE_TYPE)="+get("FILE_TYPE")+"\r\n";

	msg += "    文件大小(FILE_LENGTH)="+get("FILE_LENGTH")+"\r\n";

	msg += "    是否执行(IS_EXCUTE)="+get("IS_EXCUTE")+"\r\n";

	msg += "    创建时间(CREATE_TIME)="+get("CREATE_TIME")+"\r\n";

	msg += "    执行时间(EXCUTE_TIME)="+get("EXCUTE_TIME")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(UploadFilesBase srcObj)
{

	setWarehouseId(srcObj.getWarehouseId());

	setFileName(srcObj.getFileName());

	setFilePath(srcObj.getFilePath());

	setFileType(srcObj.getFileType());

	setFileLength(srcObj.getFileLength());

	setIsExcute(srcObj.getIsExcute());

	setCreateTime(srcObj.getCreateTime());

	setExcuteTime(srcObj.getExcuteTime());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<UploadFiles>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<WarehouseId>"+Value.view(getWarehouseId())+"</WarehouseId>";

	xml += "<FileName>"+Value.view(getFileName())+"</FileName>";

	xml += "<FilePath>"+Value.view(getFilePath())+"</FilePath>";

	xml += "<FileType>"+Value.view(getFileType())+"</FileType>";

	xml += "<FileLength>"+Value.view(getFileLength())+"</FileLength>";

	xml += "<IsExcute>"+Value.view(getIsExcute())+"</IsExcute>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";

	xml += "<ExcuteTime>"+Value.view(getExcuteTime())+"</ExcuteTime>";
	
	xml += "</UploadFiles>";
	return xml;
}

}
